#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;

typedef struct Node {
    int data;
    struct Node *link;
} Node;

struct Node *getNewNode(int x) {
    struct Node *p = (struct Node *)malloc(sizeof(struct Node));
    p->data = x;
    p->link = NULL;
    return p;
}

int find_last_k(struct Node *head, int k,int len) {
    int i;
    Node*p = head;
    if(k<=len)
    {
    	for(i = 1;i<=len-k;i++)
    	p = p->link;
    	cout<<p->data<<endl;
    	return 1;
	}
	return 0;
}

int main() {
    int n, x, k;
    scanf("%d", &n);
    struct Node head, *tail = &head;
    for (int i = 0; i < n; i++) {
        scanf("%d", &x);
        tail->link = getNewNode(x);
        tail = tail->link;
    }
    scanf("%d", &k);
    printf("find last k : %d\n", find_last_k(head.link, k,n));
    return 0;
}
